
Component({
  data: {
    select: 0,
    list: [
      {
        iconPath: "/images/home.png",
        pagePath: "/pages/index/index",
        selectedIconPath: "/images/home_active.png",
        text: "首页",
        type: 0
      },
      {
        iconPath: "/images/classify.png",
        pagePath: "/pages/classify/classify",
        selectedIconPath: "/images/classify_active.png",
        text: "分类",
        type: 0
      },
      {
        type: 1
      },
      {
        iconPath: "/images/collection.png",
        pagePath: "/pages/collection/collection",
        selectedIconPath: "/images/collection_active.png",
        text: "收藏夹",
        type: 0
      },
      {
        iconPath: "/images/mine.png",
        pagePath: "/pages/mine/mine",
        selectedIconPath: "/images/mine_active.png",
        text: "我的",
        type: 0
      }
    ]
  },
  methods: {
    selectPage(e) {
      const { index, page, type} = e.currentTarget.dataset;
      if(index !== this.data.select && type=== 0) {
        wx.switchTab({
          url: page,
        })
      }
    }
  }
})